import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

type CusRouteRecordRaw = RouteRecordRaw & {
  cmpName: string
}

const routes: CusRouteRecordRaw[] = [
  {
    cmpName: '主页',
    path: '/',
    name: 'HomeView',
    component: HomeView,
  },
  {
    cmpName: '关于',
    path: '/AboutView',
    name: 'AboutView',
    component: () => import('../views/AboutView.vue'),
  },
  {
    cmpName: 'Excel编辑器',
    path: '/Vue3ExcelEditorView',
    name: 'Vue3ExcelEditorView',
    component: () => import('../views/Vue3ExcelEditorView.vue'),
  },
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
})

export default router

export { routes }
